package com.lcy.eb.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lcy.eb.service.CommentService;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.annotation.Resource;

@Controller
@RequestMapping("comment")
public class commentController {
    @Resource
    private CommentService commentService;
    @RequestMapping("list")

    public String list(Model model,
                       @RequestParam(value="psize",defaultValue = "1")int psize){
        System.out.println("进入commentController中的list的方法");
        Page commentPage = commentService.list(psize);
        model.addAttribute("commentPage",commentPage);
        return "guestbook";
    }

}
